<%@ Page Title="Attendance Alerts" Language="C#" MasterPageFile="~/masterpage.master" AutoEventWireup="true" CodeFile="Alerts.aspx.cs" Inherits="Alerts" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

	<script language=javascript>
	function SycnTables() {
		
		var table = document.getElementById("headertable");
		var tabletosync = document.getElementById("ctl00_ContentPlaceHolder1_gvAlerts");
		
		//alert(tabletosync.childNodes[1].childNodes[0].childNodes[1].offsetWidth);
		var flag = false;
		var browseroffset = 0;
		//		alert(tabletosync.childNodes[0].childNodes[0].childNodes.length);
		if (tabletosync.childNodes.length == 1) {
			if (tabletosync.childNodes[0].childNodes[0].childNodes.length == 6)
				browseroffset = 0;
		}
		
		if (tabletosync.childNodes.length == 2) {
			if (tabletosync.childNodes[1].childNodes[1].childNodes.length == 8)
				browseroffset = 1;
		}

	

	

		for (i = 0; i < table.childNodes[0].childNodes[0].childNodes.length - 1; i++) {
			var cell = table.childNodes[0].childNodes[0].childNodes[i];
			var othercell = tabletosync.childNodes[browseroffset].childNodes[0].childNodes[i + browseroffset];
			var diff = 3;

			if (!flag)
				diff = 3;

			cell.style.width = (othercell.offsetWidth - diff) + "px";

			flag = !flag;

			//			if (cell.offsetWidth > othercell.offsetWidth) {
			//				othercell.style.width = cell.offsetWidth+"px";
			//			}
			//			else {
			//				cell.style.width = othercell.offsetWidth + "px";
			//			}
		}

	}

	var controldivname = 'ctl00_ContentPlaceHolder1_rgAlerts';
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><br />
	<table cellspacing="0" cellpadding="0" width="90%">
<tr align=left>
<td style="font-family: Arial, Helvetica, sans-serif;font-style: normal;font-size:12px;">Section:&nbsp;
	<asp:DropDownList ID="ddlSections" runat="server" DataTextField="SECTION_TITLE" 
		DataValueField="SECTION_ID">
	</asp:DropDownList>
	&nbsp;Week:&nbsp;
	<asp:DropDownList ID="ddlPeriods" runat="server" DataTextField="Title" 
		DataValueField="Start">
	</asp:DropDownList>
	&nbsp;Teacher:&nbsp;
	<asp:DropDownList ID="ddlTeachers" runat="server" DataTextField="TEACHER_NAME" 
		DataValueField="TEACHER_ID">
	</asp:DropDownList>
	&nbsp;<asp:ImageButton ID="bGo"  runat="server" ImageUrl="images/go_button.png" Text="Go" onclick="bGo_Click" />
	&nbsp
	&nbsp
	Page Size:
	&nbsp
		<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
			onselectedindexchanged="DropDownList1_SelectedIndexChanged">
			<asp:ListItem Selected="True" Value="10"></asp:ListItem>
			<asp:ListItem>25</asp:ListItem>
			<asp:ListItem>50</asp:ListItem>
			<asp:ListItem Value="-1">All</asp:ListItem>
		</asp:DropDownList>
	</td>
	<td align="right">
		<asp:ImageButton ImageUrl="Images/excel_icon2.png" ID="lbExport" runat="server" 
		onclick="lbExport_Click" ToolTip="Export to Excel" Visible="False" ></asp:ImageButton></td>
	</tr>
</tr>
</table>
<br />


<telerik:radscriptmanager ID="RadScriptManager1" Runat="server">
	</telerik:radscriptmanager>
<telerik:radgrid ID="rgAlerts" runat="server" AllowPaging="True" 
		AllowSorting="True" Width="90%" 
	 CssClass="stats"	onsortcommand="rgAlerts_SortCommand" 
		onpageindexchanged="rgAlerts_PageIndexChanged"  GridLines="None" 
		AllowAutomaticUpdates="True" AutoGenerateColumns="False" onitemdatabound="rgAlerts_ItemDataBound"
		>
<HeaderContextMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>

<FilterMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>

            <ItemStyle BackColor="Silver" />
	<AlternatingItemStyle BackColor="LightGray" />
<HeaderStyle  Font-Bold="True" Font-Underline="False" Font-Size=9 HorizontalAlign=Center  />
            <MasterTableView>
				<Columns>
				<telerik:GridBoundColumn DataField="SECTION_NAME"  HeaderStyle-Width=250  HeaderText="Section" 
			SortExpression="SECTION_NAME">
					<ItemStyle HorizontalAlign =Left VerticalAlign=Top /> 
				</telerik:GridBoundColumn>
				
				<telerik:GridHyperLinkColumn DataNavigateUrlFields="STUDENT_ID" 
			DataNavigateUrlFormatString="profile.aspx?studentId={0}" 
			DataTextField="STUDENT_NAME" HeaderText="Student Name" 
			SortExpression="STUDENT_NAME"  HeaderStyle-Width=150  >
			<ItemStyle  HorizontalAlign =Left VerticalAlign=Top />
				</telerik:GridHyperLinkColumn>
				
				<telerik:GridBoundColumn DataField="LAST_CONTACT_DATE" HeaderText="Last Contact Date" 
			SortExpression="LAST_CONTACT_DATE" HeaderStyle-Width=150 DataFormatString="{0:d}" >
			<ItemStyle HorizontalAlign="Center"/>
				</telerik:GridBoundColumn>
				
				<telerik:GridTemplateColumn   HeaderStyle-Width=100  HeaderText="Week" SortExpression="WEEK_RANGE">
				<ItemTemplate>
				<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("WEEK_RANGE") %>'></asp:HyperLink>
			</ItemTemplate>
			<ItemStyle   HorizontalAlign="Center" />
				</telerik:GridTemplateColumn>
			<telerik:GridBoundColumn DataField="DAYS_LEFT" HeaderText="Days Left" 
			SortExpression="DAYS_LEFT" ItemStyle-HorizontalAlign=Center HeaderStyle-Width=80></telerik:GridBoundColumn>
			
			<telerik:GridBoundColumn DataField="TEACHER_NAME" HeaderText="Teacher" 
			SortExpression="TEACHER_NAME"  HeaderStyle-Width=150 >
			<ItemStyle   HorizontalAlign =Left VerticalAlign=Top /> 
			</telerik:GridBoundColumn>
			
		</Columns>
	</MasterTableView>

            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling>
            </ClientSettings>

</telerik:radgrid>

</asp:Content>



